/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		RenderSceneData.cpp

					E-mail:		arise_engine@mail.ru

created:			07.03.2008
last changes:		28.04.2008
*****************************************************************************************/
#include "stdafx.h"


RenderSceneData::RenderSceneData()
{
	render_device	= 0;
	vertex_buffer	= 0;
	index_buffer	= 0;
	camera			= 0;
}
RenderSceneData::~RenderSceneData()
{
	Release();
}

bool RenderSceneData::Init()
{
	return true;
}


bool RenderSceneData::InitVertexBuffer(void* vertices_list, UINT format_size, DWORD format)
{
	if(!render_device) return false;

	Renderer* r = (Renderer*) render_device;
	return r->InitVertexBuffer(vertex_buffer, vertices_list, format_size, format);
}


bool RenderSceneData::InitVertexBuffer(void* vertices_list, UINT format_size, D3DFORMAT format)
{
	return false;
}


bool RenderSceneData::InitIndexBuffer(void* indices_list, UINT format_size, D3DFORMAT format)
{
	if(!render_device) return false;

	Renderer* r = (Renderer*) render_device;
	return r->InitIndexBuffer(index_buffer, indices_list, format_size, format);
}


void RenderSceneData::Release()
{
	SAFE_RELEASE(vertex_buffer);
	SAFE_RELEASE(index_buffer);
	texture_pool.release();
}
